import { defineConfig } from "unocss";

export default defineConfig({
  rules: [
    ["cursor-pointer", { cursor: "pointer" }],
    ["cursor-color", { color: "var(--icon-btn-color) " }],
    ["font-bold", { "font-weight": "bold" }],
  ],
  variants: [
    (matcher) => {
      if (!matcher.startsWith("hover:")) return matcher;
      return {
        // 去掉前缀并将其传递给下一个变体和规则
        matcher: matcher.slice(6),
        selector: (s) => `${s}:hover`,
      };
    },
  ],
  shortcuts: [
    ["icon-btn", "cursor-pointer hover:cursor-color"],
    ["click-any", "cursor-pointer hover:font-bold"],
  ],
});
